require("lualib_bundle");
__TS__SourceMapTraceBack(debug.getinfo(1).short_src, {["4"] = 1,["5"] = 1,["6"] = 1,["8"] = 9,["9"] = 23,["10"] = 25,["11"] = 27,["12"] = 28,["13"] = 23,["14"] = 34,["15"] = 36,["16"] = 38,["17"] = 39,["18"] = 34,["19"] = 58,["20"] = 58,["21"] = 58,["23"] = 59,["24"] = 60,["25"] = 62,["26"] = 63,["27"] = 64,["30"] = 67,["31"] = 67,["32"] = 68,["33"] = 67,["36"] = 71,["37"] = 72,["39"] = 75,["40"] = 77,["41"] = 58,["42"] = 83,["43"] = 84,["44"] = 83,["45"] = 4,["46"] = 7,["47"] = 15,["48"] = 16,["49"] = 17});
local ____exports = {}
____exports.File = __TS__Class()
local File = ____exports.File
File.name = "File"
function File.prototype.____constructor(self)
end
function File.escape(self, contents)
    contents = string:gsub(contents, ____exports.File.escapeCharacter, ____exports.File.escapedSelf)[0]
    contents = string:gsub(contents, "\"", ____exports.File.escapedQuote)[0]
    return contents
end
function File.unescape(self, contents)
    contents = string:gsub(contents, ____exports.File.escapedQuote, "\"")[0]
    contents = string:gsub(contents, ____exports.File.escapedSelf, ____exports.File.escapeCharacter)[0]
    return contents
end
function File.writeRaw(self, filename, contents, allowReading)
    if allowReading == nil then
        allowReading = false
    end
    PreloadGenClear()
    PreloadGenStart()
    if allowReading then
        Preload("\")\n//! beginusercode\nlocal o=''\nPreload=function(s)o=o..s end\nPreloadEnd=function()end\n//!endusercode\n//")
        contents = ____exports.File:escape(contents)
    end
    do
        local i = 0
        while i < #contents / ____exports.File.preloadLimit do
            Preload(__TS__StringSubstr(contents, i * ____exports.File.preloadLimit, ____exports.File.preloadLimit))
            i = i + 1
        end
    end
    if allowReading then
        Preload(("\")\n//! beginusercode\nBlzSetAbilityIcon(" .. tostring(self.dummyAbility)) .. ",o)\n//!endusercode\n//")
    end
    PreloadGenEnd(filename)
    return self
end
function File.write(self, filename, contents)
    return self:writeRaw(filename, contents, true)
end
File.dummyAbility = FourCC("Amls")
File.preloadLimit = 259
File.escapeCharacter = string.char(27)
File.escapedSelf = ____exports.File.escapeCharacter .. ____exports.File.escapeCharacter
File.escapedQuote = ____exports.File.escapeCharacter .. "q"
return ____exports
